package com.gcs.demo.exception;

import com.gcs.demo.pojo.ResultInfo;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(ParamNotRequire.class)
    @ResponseBody
    public ResultInfo paramNotRequire(Exception e){
        return new ResultInfo(500,e.getMessage(),null);
    }

}
